package com.yang.IO;

import org.junit.Test;

import java.io.*;

/**
 * @Description: TODO
 * @Author: YangTing
 * @Date: 2024-05-07 08:52
 */

public class TransformEncoding {
    @Test
    public void test1() throws IOException {
        File src = new File("");
        File desc = new File("");

        FileInputStream fis = new FileInputStream(src);
        InputStreamReader isr = new InputStreamReader(fis,"");

        FileOutputStream fos = new FileOutputStream(desc);
        OutputStreamWriter osw = new OutputStreamWriter(fos,"");

        char[] cBuffer = new char[1024];
        int len;
        while ((len = isr.read(cBuffer)) != -1){
            osw.write(cBuffer,0,len);
        }

        osw.close();
        isr.close();
    }
}
